-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REGR: concat materializing index even if sort is not necessary #47508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -157,7 +157,7 @@ def _get_combined_index( | |||
index = union_indexes(indexes, sort=False) | |||
index = ensure_index(index) | |||
|
|||
if sort: | |||
if sort and not index.is_monotonic_increasing: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe better to just have safe_sort check this internally? (we do this in sort_values for example)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Index.is_monotonic_decreasing
as well?
Also I think a separate PR will need to be made against 1.4.x. safe_sort_index
below is available on main and not 1.4.x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sorry, should have mentioned this. I’ll clean this up after this is backported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So to confirm, once this is merged into main and backported, you'll modify the backport branch to be compatable with the 1.4.x branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No this should be compatible with 1.4.x if I am not missing anything.
I will create a new pr after this is merged and will move the no op check to safe_sort_index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay gotcha. So does is_monotonic_decreasing
also need to be added too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t think so, if you want to sort and it is decreasing, you would have to turn the Range index around basically. We could add some logic for this, but not for 1.4.x I think
this version prob ok for 1.4 can do enhanced for 1.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @jreback if any additional comments
Thanks @phofl |
This comment was marked as resolved.
This comment was marked as resolved.
Could you manual backport when you get the chance @phofl? |
Yep, will do tomorrow |
…s-dev#47508) * REGR: concat materializing index even if sort is not necessary * Add check for index * Add exact
The conflict was caused by tests :) |
…even if sort is not necessary )" (#47565)
…s-dev#47508) * REGR: concat materializing index even if sort is not necessary * Add check for index * Add exact
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.